/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package servidor;

import Protocolo.*;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

        /**
 *
 * @author CUC103AF08
 */
public class Main {

    public static String leerConfig() throws FileNotFoundException{
    FileReader fr = new FileReader("config.txt");
    BufferedReader entrada = new BufferedReader(fr);
    String s="";
    try {
           s = entrada.readLine();
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    return s;
    }
    public static void main(String[] args){
        Servidor server;
        try {
            server = new Servidor(new ConexionServidor(Integer.valueOf(leerConfig())));
            server.start();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }        
    }
}

